home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Extras / IFF / IFF_Forms / OB3D.proposal < prev    next >
Encoding:
Text File  |  1993-03-01  |  36.6 KB  |  1,257 lines

  1. Proposal for a stadard 3D object format
  2.  
  3.                     FORM OB3D (revision 1)
  4.                    ------------------------
  5.                               by
  6.                        Roberto Speranza
  7.  
  8.  
  9.    This is a modified specification of the OB3D FORM, proposed a few
  10. weeks ago.   Much concern was raised about the earlier FORM's inflexibility.
  11. I have tried to address that here by adding flexibility to the majority of
  12. the chunks by making them tag-based.
  13.     This will define what I consider to be the bare minimum I require of
  14. this FORM for my own program plus anything I can think of to accomodate other
  15. programs I am aware of as well suggestions posed by others.  Additional chunks
  16. or additional tags for chunks currently defined in this proposal will have
  17. to be discussed as soon as possible after this posting.  I want this minimum
  18. definition approved so that I can begin the task of re-writing my reader/writer
  19. software to handle all of this.  To add the flexibility requested, the reader
  20. software has to increase in complexity somewhat.   Here are a few
  21. highlights of the revised FORM:
  22.  
  23. - almost all chunks are tag-based
  24. - SPLN chunk updated to handle NURBs (non-uniform rational B-Splines)
  25. - SURF and NURB chunk merged with a new chunk, PRIM, which will contain
  26.   ALL primitives; polygons, bicubic surfaces, NURB surfaces, and other
  27.   primitives such as spheres, cones, etc.
  28. - precision concerns have been eliminated by the addition of variables
  29.   to the PREF chunk that are designed to inform the reader software of
  30.   the precision of floats used in the file
  31. - the addition of a MACR chunk for stroing ASCII macros such as AREXX
  32.   macros or scripts
  33.  
  34.  
  35.    The following is a list of chunks and their descriptions followed by
  36. a detailed description of all the tags currently defined.
  37.  
  38. -----------------------------------------------------------------------------
  39. FORM
  40.  
  41.  
  42. struct FORMstruct
  43. {
  44.    ULONG ID;
  45.    ULONG Size;
  46. }
  47.  
  48.  
  49. OB3D
  50.  
  51.  
  52. PREF (optional)
  53.  
  54. struct PREFstruct
  55. {
  56.    ULONG Id;
  57.    ULONG Size;
  58.    UWORD preflines;
  59.    ULONG prefsize;
  60.    UBTE Prefs[prefsize];
  61.    UBTE pad;  /* to make chunk even length, if necessary */
  62. }
  63.  
  64. The character array Prefs consists of lines of ASCII text terminated by
  65. newlines (\n).   The NumLines field tells you how many lines in case you want
  66. to read it in a line at a time.
  67.  
  68. Each line takes the following form:
  69.  
  70. variable=value(s)   (more than one value will be separated by spaces)
  71.  
  72. This type of preferences layout was selected for generality and easy
  73. expansion.  This will also allow for program preferences to be stored in IFF form.
  74. If this chunk is present, it will contain preferences for the reader code
  75. as well as any program preferences.  Here are some variables to start us off:
  76.  
  77.  
  78.    Variable       Suggested Value(s)
  79.    --------       ------------------
  80.  
  81.    TIMEUNITS      FRAMES or SECONDS depending on application
  82.  
  83.    FRAMERATE      60
  84.  
  85.    TIMEFLOAT      IEEESINGLE   (32 bit)
  86.                   CHARSTRING   ( length (UWORD) + length characters )
  87.                                (not null terminated)
  88.                   ULONGINT     (32 bit)
  89.  
  90.    TIMEBASE       1            (number to divide TIMEFLOAT by to get value in TIMEUNITS)
  91.                                (primarily for specifying how to convert ULONGINTS to
  92.                                 a floating point quantity if desired)
  93.  
  94.    STARTFRAME     1 (or whatever)
  95.  
  96.    ATTFLOAT       IEEESINGLE   (32 bit)
  97.                   CHARSTRING   ( length (UWORD) + length characters )
  98.                                (not null terminated)
  99.                   UBTE        ( 8 bit)
  100.                   UWORDINT     (16 bit)
  101.                   ULONGINT     (32 bit)
  102.  
  103.    ATTBASE        1            (number to divide ATTFLOAT by to get value in TIMEUNITS)
  104.                                (primarily for specifying how to convert non-floating
  105.                                 point quantities to a floating point quantity if desired)
  106.  
  107.    FLOAT          IEEESINGLE   (32 bit)
  108.                   CHARSTRING   ( length (UWORD) + length characters )
  109.                                (not null terminated)
  110.  
  111.    COORFLOAT      IEEESINGLE   (32 bit)
  112.                   IEEEDOUBLE   (64 bit)
  113.                   IEEEEXTENDED (96 bit)
  114.                      This is supported by the
  115.                      MC6888x FPUs. Manx's m.lib
  116.                      supports this format as a
  117.                      long double.
  118.                   CHARSTRING   ( length (UWORD) + length characters )
  119.                                (not null terminated)
  120.  
  121.    ANGLEUNITS     DEGREES
  122.                   RADIANS
  123.  
  124.    DISTANCEUNITS  MILLIMETRES
  125.                   CENTIMETRES
  126.                   METRES
  127.                   KILOMETRES
  128.                   INCHES
  129.                   FEET
  130.                   ARDS
  131.                   MILES
  132.  
  133. -----------------------------------------------------------------------------
  134. MACR (optional)
  135.  
  136. struct MACRstruct
  137. {
  138.    ULONG Id;
  139.    ULONG Size;
  140.    ULONG NumMacros;
  141.    struct
  142.    {
  143.       UWORD namelen;       /* length of name */
  144.       UBTE name[namelen]; /* name of macro  */
  145.       ULONG macsize;
  146.       UWORD maclines;
  147.       UBTE Macro[macsize];
  148.    } [NumMacros]
  149.    UBTE pad;  /* to make chunk even length, if necessary */
  150. }
  151.  
  152. The character array Macro consists of lines of ASCII text
  153. terminated by newlines (\n).  The field maclines tells you how many lines
  154. of text are in the macro in case you want to read it one line at a time.
  155.  
  156. -----------------------------------------------------------------------------
  157. SBAS (optional)
  158.  
  159. struct SBASstruct
  160. {
  161.    ULONG ID;
  162.    ULONG Size;
  163.    ULONG NumSBASes;
  164.    struct
  165.    {
  166.       UWORD basisnum; /* basis number */
  167.       UWORD step; /* point step */
  168.       COORFLOAT Basis[4][4]; /* basis matrix */
  169.    } [NumSBASes];
  170.    UBTE pad;  /* to make chunk even length, if necessary */
  171. }
  172.  
  173. This chunk is only required if bicubic surfaces or splines are stored in
  174. the file.  This chunk defines the basis matrix to convert the
  175. control points of the spline to coefficients for the cubic equation that
  176. describes the spline.   The step parameter dictates how to apply the
  177. basis matrix to splines which use more than 4 control points but are
  178. still cubic in nature (like more than one linked up together).
  179.  
  180. I believe three basis numbers should be reserved for these common
  181. splines:
  182.  
  183.    Number   Spline Type
  184.    ------   -----------
  185.  
  186.       0     Bezier spline
  187.       1     Uniform non-rational B-spline
  188.       2     Catmull-Rom spline
  189.  
  190.  
  191. I selected these spline types because they are the most common
  192. ones used in modellers and CAD packages.  Any other type can be
  193. defined at will, allowing for custom splines.
  194.  
  195. -----------------------------------------------------------------------------
  196. TRGB (optional)
  197.  
  198. struct TRGBstruct
  199. {
  200.    ULONG ID;
  201.    ULONG Size;
  202.    ULONG NumTRGBs;
  203.    struct
  204.    {
  205.       UWORD NumColours; /* number of components in colour model */
  206.       FLOAT ToRGB[NumColours][3]; /* transformation matrix */
  207.    } [NumTRGBs];
  208.    UBTE pad;  /* to make chunk even length, if necessary */
  209. }
  210.  
  211. This chunk is optional if all colour data is specified using the RGB colour
  212. model. The transformation matrix for RGB colour data is simply a 3X3 identity
  213. matrix.
  214.  
  215. For any other colour model, this chunk should be present in order to specify
  216. the number of components used for colours as well as the transformation matrix
  217. used to multiply the colours in the file to RGB.  This should suffice for most
  218. colour models.
  219.  
  220. example:
  221.  
  222.    [t00 t01 ... t0n][c0] = [R]
  223.    |t10 t11 ... t1n||c1|   |G|
  224.    [t20 t21 ... t2n]|..|   [B]
  225.                     [..]
  226.                     [cn]
  227.  
  228. -----------------------------------------------------------------------------
  229. VERT  (optional only when HIER chunk is present else not included)
  230.  
  231. struct VERTstruct
  232. {
  233.    ULONG Id;
  234.    ULONG Size;
  235.    ULONG NumVERTs;
  236.    struct
  237.    {
  238.       ULONG numtags;
  239.       struct
  240.       {
  241.          ULONG tagtype;
  242.          UBTE data[tagsize];
  243.       } [numtags]
  244.    } [NumVERTs];
  245.    UBTE pad;  /* to make chunk even length, if necessary */
  246. }
  247.  
  248. The VERT chunk stores all vertex information.  This structure is
  249. now tag-based to allow for future expansion and flexibility.  The
  250. following tags are applicable to the VERT chunk:
  251.  
  252.         OB3D_Parent
  253.         OB3D_Clone
  254.         OB3D_RelSurf
  255.         OB3D_TimeStamp
  256.         OB3D_Cycle
  257.         OB3D_Interpolation
  258.         OB3D_Script
  259.  
  260.         VERT_Position
  261.         VERT_Velocity
  262.  
  263. -----------------------------------------------------------------------------
  264. EDGE  (optional; if VERT chunk is missing, it is not included)
  265.  
  266.    struct EDGEstruct
  267.    {
  268.       ULONG ID;
  269.       ULONG Size;
  270.       ULONG NumEDGEs;
  271.       struct
  272.       {
  273.          ULONG points[2];   /* index to two points of edge */
  274.          ULONG numtags;     /* hook for future tags */
  275.          struct
  276.          {
  277.             ULONG tagtype;
  278.             UBTE data[tagsize];
  279.          } [numtags]
  280.       } [NumEDGEs]
  281.       UBTE pad;  /* to make chunk even length, if necessary */
  282.    }
  283.  
  284. The EDGE chunk stores all edges for programs that use a wireframe
  285. representation in their editors or renderers.  Programs that do not
  286. require edges do not need to store this chunk in their files.  This
  287. will force programs who require edges to reconstruct the edges or
  288. represent the objects with a bounding box.  The tags that are
  289. applicable to this chunk are:
  290.  
  291.      none at this time
  292.  
  293.  
  294. -----------------------------------------------------------------------------
  295. SPLN  (optional; if VERT chunk is missing, it is not included)
  296.  
  297.    struct SPLNstruct
  298.    {
  299.       ULONG ID;
  300.       ULONG Size;
  301.       ULONG NumSPLNs;
  302.       struct
  303.       {
  304.          ULONG numpts; /* number of points */
  305.          ULONG points[numpts]; /* control pts indices */
  306.          ULONG numtags;
  307.          struct
  308.          {
  309.             ULONG tagtype;
  310.             UBTE data[tagsize];
  311.          } [numtags]
  312.       } [NumSPLNs]
  313.       UBTE pad;  /* to make chunk even length, if necessary */
  314.    }
  315.  
  316.  
  317. The SPLN chunk is used to store any spline information.  By using various
  318. tags, any cubic spline or NURB (non-uniform rational B-spline) can
  319. be stored.  The following is a list of tags that can be used for the SPLN
  320. chunk:
  321.  
  322.         SPLN_Basis
  323.         SPLN_NURB_Order
  324.         SPLN_TrimSurf
  325.         SPLN_NURBKnots
  326.         SPLN_NURBWeights
  327.  
  328. NOTE: (for cubic splines only)
  329.  
  330.    numpts=4+n*basisstep
  331.  
  332.    where         n =  any integer from 0 to infinity
  333.          bassistep =  the step value of the basis matrix
  334.                       used for the spline
  335.  
  336. -----------------------------------------------------------------------------
  337. PRIM  (optional unless HIER and VERT chunk are missing because it is not included)
  338.  
  339.    struct PRIMstruct
  340.    {
  341.       ULONG ID;
  342.       ULONG Size;
  343.       ULONG NumPRIMs;
  344.       ULONG numtags;
  345.       struct
  346.       {
  347.          ULONG tagtype;
  348.          UBTE data[tagsize];
  349.       } [NumPRIMs];
  350.       UBTE pad;  /* to make chunk even length, if necessary */
  351.    }
  352.  
  353.    Bicubic surfaces have played a very important role of late in CAD and
  354. commercial graphics.  Applications on the Amiga are now starting to model
  355. objects using bicubic surfaces making this chunk a necessity.
  356.    The importance of the NURB (non-uniform rational B-Spline) has come
  357. about due to the need to represent conics and quadrics accurately
  358. using parametric surfaces.  Bicubic surfaces can only approximate these
  359. surfaces but NURB surfaces can represent them exactly and enjoy the
  360. flexibility of B-splines as well.
  361.    By using various tags, this chunk can store any primitive including
  362. bicubic surfaces, NURB surfaces or polygons.
  363.    This chunk will be used to specify primitive objects.  It is
  364. tag-based, allowing for expansion as different primitives are supported in
  365. the future.   The following tags are applicable to this chunk:
  366.  
  367.         OB3D_Parent
  368.         OB3D_TimeStamp
  369.         OB3D_Cycle
  370.         OB3D_Interpolation
  371.         OB3D_Script
  372.  
  373.         PRIM_Points
  374.         PRIM_PolySmoothing
  375.         PRIM_SurfBasis
  376.         PRIM_NURBOrder
  377.         PRIM_Contours
  378.         PRIM_NURBKnots
  379.         PRIM_NURBWeights
  380.         PRIM_TextureSpace
  381.         PRIM_RectangularSolid
  382.         PRIM_Ellipsoid
  383.         PRIM_Prism
  384.         PRIM_SurfaceRevolution
  385.         PRIM_SemiInfiniteSpace
  386.         PRIM_RiSphere
  387.         PRIM_RiCone
  388.         PRIM_RiDisk
  389.         PRIM_RiCylinder
  390.         PRIM_Hyperboloid
  391.         PRIM_RiParaboloid
  392.         PRIM_RiTorus
  393.  
  394.  
  395. -----------------------------------------------------------------------------
  396. HIER  (optional; excluded if file is missing both VERT and LAMP chunks)
  397.  
  398. struct HIERstruct
  399. {
  400.    ULONG ID;
  401.    ULONG Size;
  402.    ULONG NumHiers; /* Number of Hierarchies in chunk */
  403.    struct
  404.    {
  405.       ULONG numtags;
  406.       struct
  407.       {
  408.          ULONG tagtype;
  409.          UBTE data[tagsize];
  410.       } [numtags]
  411.    } [NumHiers];
  412.  
  413.    UBTE pad;  /* to make chunk even length, if necessary */
  414. }
  415.  
  416. The Hierarchy chunk is used to describe the relationships between objects,
  417. paths and lamps.   The following tags are applicable to this chunk:
  418.  
  419.         OB3D_Name
  420.         OB3D_Parent
  421.         OB3D_Clone
  422.         OB3D_TimeStamp
  423.         OB3D_Cycle
  424.         OB3D_Interpolation
  425.         OB3D_Texture
  426.         OB3D_Script
  427.  
  428.         HIER_Type
  429.         HIER_CustomTypeName
  430.         HIER_HierStatus
  431.         HIER_BoundingBox
  432.         HIER_LampType
  433.         HIER_Size
  434.         HIER_Shear
  435.         HIER_LocalOrigin
  436.         HIER_Velocity
  437.         HIER_Axes
  438.         HIER_PRAngles
  439.         HIER_XZAngles
  440.         HIER_Translate
  441.         HIER_RelPRAngles
  442.         HIER_RelXZAngles
  443.  
  444. -----------------------------------------------------------------------------
  445. ATTR  (optional if TXTR is not present)
  446.  
  447.    struct ATTRstruct
  448.    {
  449.       ULONG ID;
  450.       ULONG size;
  451.       ULONG NumATTRs;
  452.       struct
  453.       {
  454.          ULONG numtags;
  455.          struct
  456.          {
  457.             ULONG tagtype;
  458.             UBTE data[tagsize]
  459.          } [numtags]
  460.       } [NumATTRs]
  461.  
  462.       UBTE pad;  /* to make chunk even length, if necessary  */
  463.    }
  464.  
  465. The ATTR chunk stores all information about attributes.  The following tags
  466. are used for this chunk:
  467.  
  468.         OB3D_Name
  469.         OB3D_TimeStamp
  470.         OB3D_Cycle
  471.         OB3D_Interpolation
  472.  
  473.         ATTR_ColourSize
  474.         ATTR_Diffuse
  475.         ATTR_Reflect
  476.         ATTR_Transmit
  477.         ATTR_Ambient
  478.         ATTR_Illumin
  479.         ATTR_Opacity
  480.         ATTR_IndexRefract
  481.         ATTR_SpecHighLight
  482.         ATTR_PhongHighLight
  483.         ATTR_HighlightColour
  484.         ATTR_LightIntensity
  485.         ATTR_LightDirection
  486.         ATTR_ConeLight
  487.         ATTR_AreaLight
  488.         ATTR_Fog
  489.         ATTR_DepthCue
  490.         ATTR_EnvironIllumin
  491.         ATTR_EnvIndexRefract
  492.  
  493. I am sure there are attributes that have been missed.  Further
  494. discussion and debate over this specification should result in the
  495. missing attributes being defined.
  496.  
  497. -----------------------------------------------------------------------------
  498. TXTR  (optional)
  499.  
  500.    struct TXTRstruct
  501.    {
  502.       ULONG ID;
  503.       ULONG Size;
  504.       ULONG NumTXTRs;
  505.       struct
  506.       {
  507.          UWORD namelen;
  508.          UBTE name[namelen]; /* name of texture */
  509.          ULONG numtags; /* number of tags for texture */
  510.          struct
  511.          {
  512.             ULONG tagtype;
  513.             UBTE data[tagsize];
  514.          } [numtags]
  515.       } [NumTXTRs];
  516.  
  517.       UBTE pad;  /* to make chunk even length, if necessary  */
  518.    }
  519.  
  520. The TXTR chunk stores all information about textures.  The following tags
  521. are used for this chunk:
  522.  
  523.         OB3D_Name
  524.         OB3D_TimeStamp
  525.         OB3D_Cycle
  526.         OB3D_Interpolation
  527.         OB3D_Texture
  528.         OB3D_Script
  529.  
  530.         TXTR_RenderType
  531.         TXTR_Space
  532.         TXTR_BoundingBox
  533.         TXTR_Center
  534.         TXTR_BitMap
  535.         TXTR_Checker
  536.         TXTR_Gradient
  537.         TXTR_Brick
  538.         TXTR_Wood
  539.         TXTR_Wave
  540.         TXTR_BumpMap
  541.  
  542.  
  543. I have just defined some textures to start us off.  I attempted to define
  544. some common textures used by most amiga rendering programs.  Further
  545. discussion and debate over this specification should result in the
  546. missing attributes being defined.
  547.  
  548. -----------------------------------------------------------------------------
  549. BACK  (optional)
  550.  
  551.    struct BACKstruct
  552.    {
  553.       ULONG ID;
  554.       ULONG Size;
  555.       ULONG numtags;
  556.       struct
  557.       {
  558.          ULONG tagtype;
  559.          UBTE data[tagsize];
  560.       } [numtags]
  561.    }
  562.  
  563.  
  564.    The BACK chunk is used to store all information required to describe
  565. the background of a rendered scene.  As needs expand, tags can be added
  566. to accomodate additional information.
  567.  
  568.         BACK_GroundTexture
  569.         BACK_SkyTexture
  570.         BACK_EnviroTexture
  571.  
  572. -----------------------------------------------------------------------------
  573. OBSV  (optional)
  574.  
  575.    struct OBSVstruct
  576.    {
  577.       ULONG ID;
  578.       ULONG Size;
  579.       ULONG NumOBSVs;
  580.       struct
  581.       {
  582.          ULONG numtags;
  583.          struct
  584.          {
  585.             ULONG tagtype;
  586.             UBTE data[tagsize];
  587.          } [numtags]
  588.       } [NumOBSVs]
  589.    }
  590.  
  591.    The OBSV chunk stores all parameters necessary to describe the view.
  592. The following tags are applicable to this chunk:
  593.  
  594.         OB3D_TimeStamp
  595.         OB3D_Cycle
  596.         OB3D_Interpolation
  597.  
  598.         OBSV_ObserverHierarchy
  599.         OBSV_TargetHierarchy
  600.         OBSV_Observer
  601.         OBSV_Target
  602.         OBSV_Distance
  603.         OBSV_Orientation
  604.         OBSV_Tilt
  605.         OBSV_FieldofView
  606.         OBSV_RecordingMedium
  607.         OBSV_FocalLength
  608.         OBSV_Aperture
  609.         OBSV_StopNumber
  610.         OBSV_ShutterSpeed
  611.         OBSV_Separation
  612.  
  613. -----------------------------------------------------------------------------
  614. DISP  (optional)
  615.  
  616.    struct DISPstruct
  617.    {
  618.       ULONG ID;
  619.       ULONG Size;
  620.       ULONG NumDisps;
  621.       struct
  622.       {
  623.          ULONG numtags;
  624.          struct
  625.          {
  626.             ULONG tagtype;
  627.             UBTE data[tagsize];
  628.          } [numtags]
  629.       } [NumDisps]
  630.    }
  631.  
  632. The DISP chunk is to be used to save the various displays programs use.
  633. The tags used for this chunk are:
  634.  
  635.         OBSV_Observer
  636.         OBSV_Target
  637.         OBSV_Distance
  638.         OBSV_Orientation
  639.         OBSV_Tilt
  640.         OBSV_FieldofView
  641.         OBSV_RecordingMedium
  642.         OBSV_FocalLength
  643.         OBSV_Aperture
  644.         OBSV_StopNumber
  645.         OBSV_ShutterSpeed
  646.         OBSV_Separation
  647.  
  648.         DISP_WindowParms
  649.         DISP_ViewStatus
  650.         DISP_FrameRate
  651.  
  652. -----------------------------------------------------------------------------
  653.  
  654. Tags for the OB3D FORM
  655. ----------------------
  656.  
  657. Label                  Offset
  658. Data                   Description
  659. ----                   -----------
  660.  
  661.                        OB3D_TagBase+ (0x00000000)
  662. OB3D_Name                   0
  663. UWORD namelen;
  664. UBTE name[namelen];   name of entity (not null terminated)
  665.  
  666. OB3D_Parent                 1
  667. ULONG parent;          index to parent entity
  668.  
  669. OB3D_Clone                  2
  670. ULONG clone;           index to clone entity
  671.  
  672. OB3D_RelSurf                3
  673. ULONG relsurf;         index to clone entity
  674.  
  675. OB3D_TimeStamp              4
  676. TIMEFLOAT timestamp;   timestamp for tags that follow
  677.  
  678. OB3D_Cycle                  5
  679. TIMEFLOAT start,
  680. TIMEFLOAT length;      start ad length of cycle
  681.  
  682. OB3D_Interpolation          6
  683. ULONG status;          interpolate parameters to next key-frame
  684.                        possible status flags are:
  685.  
  686.                            Label       Value  Description
  687.                            -----       -----  -----------
  688.  
  689.                                   0x00000800  reserved for interpolation
  690.                                       to      flags not yet contemplated
  691.                                   0x00000010
  692.  
  693.                         PVSPLINE  0x00000008  spline parameters to next
  694.                                               key-frame using positions
  695.                                               and velocities
  696.  
  697.                          PSPLINE  0x00000004  spline parameters to
  698.                                               next key-frame using
  699.                                               positions only
  700.  
  701.                           LINEAR  0x00000002  linearly interpolate
  702.                                               parameters to next key-frame
  703.  
  704.                              OFF  0x00000001  turn off
  705.  
  706.  
  707. OB3D_Texture                7
  708. ULONG texture;         index to entity's texture
  709.  
  710. OB3D_Script                 8
  711. UWORD namelen;
  712. UBTE name[namelen];   name of script
  713.  
  714. -----------------------------------------------------------------------------
  715.                        VERT_TagBase+ (0x00010000)
  716. VERT_Position               0
  717. COORFLOAT position[3];   position of vertex at the indicated key-frame
  718.  
  719. VERT_Velocity               1
  720. COORFLOAT velocity[3];   velocity of vertex at the indicated key-frame
  721.  
  722. -----------------------------------------------------------------------------
  723.  
  724.                        SPLN_TagBase+ (0x00020000)
  725. SPLN_Basis                  0
  726. UWORD basisnum;          index to basis matrix for cubic spline
  727.  
  728. SPLN_NURB_Order             1
  729. UWORD order;             order of NURB
  730.  
  731. SPLN_TrimSurf               2
  732. ULONG trimsurf;          index to surface that this spline trims
  733.  
  734. SPLN_NURBKnots              3
  735. UWORD num;
  736. FLOAT knots[num];        array of knot values for NURB
  737.  
  738. SPLN_NURBWeights            4
  739. COORFLOAT
  740. weights[numpts];         array of weights for control points
  741.  
  742. -----------------------------------------------------------------------------
  743.  
  744.                        PRIM_PolyTagBase+ (0x00030000)
  745. PRIM_Points                 0
  746. ULONG numpts;
  747. ULONG points[numpts];    array of control point indices
  748.                          (for NURB and bicubic surfaces,
  749.  
  750.                            numpts = upts*vpts
  751.                            where there are vpts rows of upts indices)
  752.  
  753.  
  754. PRIM_PolySmoothing          1
  755. UWORD smoothing;         The smoothing variable describes the type
  756.                          of normal smoothing to use when rendering
  757.                          polygons.
  758.                          The following values are valid:
  759.  
  760.                          0 - no smoothing
  761.                          1 - Phong normal smoothing
  762.  
  763.                        PRIM_SurfTagBase+ (0x00031000)
  764. PRIM_SurfBasis              5
  765. UWORD ubasis, vbasis;    basis index for u and v direction
  766.  
  767. PRIM_NURBOrder              1
  768. UWORD uorder, vorder;    order of NURB for both u and v directions
  769.  
  770. PRIM_Contours               2
  771. UWORD ucon, vcon;        contours for both u and v direction
  772.  
  773. PRIM_NURBKnots              3
  774. UWORD unum, vnum;
  775. FLOAT uknots[unum];
  776. FLOAT vknots[vnum];      NURB knots for both u and v direction
  777.  
  778. PRIM_NURBWeights            4
  779. COORFLOAT weights
  780. [numupts*numvpts];       array of weights for control points
  781.  
  782. PRIM_TextureSpace           5
  783. FLOAT umin, vmin,
  784.       umax, vmax;        Mapping limits in texture space
  785.  
  786.  
  787.                        PRIM_PrimTagBase+ (0x00032000)
  788. PRIM_RectangularSolid       0
  789.                          orientation/size/position determined by parent
  790.                          hierarchy
  791.  
  792. PRIM_Ellipsoid              1
  793.                          orientation/size/position determined by parent
  794.                          hierarchy
  795.  
  796. PRIM_Prism                  2
  797. ULONG hierindex;         extrusion of any contour by a specified length
  798.                          index to hierarchy containing the contour and
  799.                          parent hierarchy determines the size
  800.  
  801. PRIM_SurfaceRevolution      3
  802. UWORD axis;              0 - X,   1 - ,   2 - Z
  803. FLOAT anglerev;          a contour spun around a specific axis
  804.  
  805. PRIM_SemiInfiniteSpace      4
  806. COORFLOAT
  807. vec1[3], vec2[3];        a plane whose normal (right hand rule)
  808.                          defines the direction in which the
  809.                          space extends
  810.  
  811. PRIM_RiSphere               5
  812. COORFLOAT radius;
  813. COORFLOAT zmin, zmax;
  814. FLOAT thetamax;          sphere primitive ala RenderMan
  815.  
  816. PRIM_RiCone                 6
  817. COORFLOAT radius;
  818. COORFLOAT height;
  819. FLOAT thetamax;          cone primitive ala RenderMan
  820.  
  821. PRIM_RiDisk                 7
  822. COORFLOAT radius;
  823. COORFLOAT height;
  824. FLOAT thetamax;          disk primitive ala RenderMan
  825.  
  826. PRIM_RiCylinder             8
  827. COORFLOAT radius;
  828. COORFLOAT zmin, zmax;
  829. FLOAT thetamax;          cylinder primitive ala RenderMan
  830.  
  831. PRIM_Hyperboloid            9
  832. COORFLOAT point1[3],
  833.           point2[3];
  834. FLOAT thetamax;          hyperboloid primitive ala RenderMan
  835.  
  836. PRIM_RiParaboloid          10
  837. COORFLOAT radiusmax;
  838. COORFLOAT zmin, zmax;
  839. FLOAT thetamax;          cylinder primitive ala RenderMan
  840.  
  841. PRIM_RiTorus               11
  842. COORFLOAT majorrad, minorrad;
  843. COORFLOAT phimin, phimax;
  844. FLOAT thetamax;          cylinder primitive ala RenderMan
  845.  
  846.  
  847.             for details of the RenderMan primitives above,
  848.                         consult pp. 62-63 of the RenderMan Companion by
  849.                         Steve Upstill (Publisher: Addison Wesley)
  850.  
  851. -----------------------------------------------------------------------------
  852.  
  853.                        HIER_TagBase+ (0x00040000)
  854. HIER_Type                   0
  855. ULONG type;             type of hierarchy
  856.                         Currently, the following types are supported:
  857.  
  858.                            Type  Label          Description
  859.                            ----  -----          -----------
  860.  
  861.                             0    HT_EMPT       empty
  862.  
  863.                             1    HT_PATH        path
  864.  
  865.                             2    HT_OBJECT      object defined using vertices
  866.  
  867.                             4    HT_CSGOBJECT   object defined using PRIMitives
  868.  
  869.                             5    HT_LAMP        lamp and possibly objects
  870.                                                 (for compatibility with existing software)
  871.  
  872.                             6    HT_CUSTOM      custom object (type name supplied with tag)
  873.  
  874.                            10    HT_SSOBJECTS  objects for internal use only
  875.  
  876. HIER_CustomTypeName         1
  877. UWORD namelen;
  878. UBTE name[namelen];   name of custom hierarchy type (not null terminated)
  879.  
  880.  
  881.  
  882. HIER_HierStatus             2
  883. ULONG status;           status of hierarchy
  884.  
  885.                         Label       Value       Description
  886.                         -----       -----       -----------
  887.  
  888.                                     0x00800000  reserved for future use
  889.                                         to
  890.                                     0x00010000
  891.  
  892.                         HEEDGES     0x00008000  draw object during operation
  893.  
  894.                         HEEXTENT    0x00004000  draw extent during operation
  895.  
  896.                         HNEDGES     0x00002000  draw object when refreshing
  897.  
  898.                         HNEXTENT    0x00001000  draw extent when refreshing
  899.  
  900.                                     0x00000800  reserved for future use
  901.                                         to
  902.                                     0x00000080
  903.  
  904.                         HUNION      0x00000040  object Boolean OR
  905.  
  906.                         HINTERSECT  0x00000020  object Boolean AND
  907.  
  908.                         HSUB        0x00000010  object subtract
  909.  
  910.                         HOFF        0x00000008  object/hierarchy is off
  911.                                                 in editor
  912.                         HTPEDIT     0x00000004  object surface trim curve
  913.                                                 points are editable
  914.                         HEDIT       0x00000002  object surface control
  915.                                                 points are editable
  916.                         HSELECT     0x00000001  object is selected
  917.  
  918.  
  919.  
  920. HIER_BoundingBox            3
  921. FLOAT low[3], high[3];  bounding box of hierarchy
  922.  
  923. HIER_LampType               4
  924. UWORD lamptype;         lamp type/behaviour
  925.                            0 - directional light source
  926.                            1 - point source (inverse square law)
  927.                            2 - conical light source
  928.                            3 - cylindrical light source
  929.                            4 - area light source
  930.  
  931.  
  932. HIER_Size                   5
  933. COORFLOAT size[3];      size of axes
  934.  
  935. HIER_Shear                  6
  936. COORFLOAT shear[6];     size of shear components
  937.                            0 - X-axis -component
  938.                            1 - X-axis Z-component
  939.                            2 - -axis X-component
  940.                            3 - -axis Z-component
  941.                            4 - Z-axis X-component
  942.                            5 - Z-axis -component
  943.  
  944. HIER_LocalOrigin            7
  945. COORFLOAT locorig[3];   position wrt. parent's space
  946.  
  947. HIER_Velocity               8
  948. COORFLOAT velocity[3];  velocity wrt. parent's space
  949.  
  950. HIER_Axes                   9
  951. COORFLOAT axes[3][3];   normalized axes
  952.                            row 0 - X axis
  953.                            row 1 -  axis
  954.                            row 2 - Z axis
  955.  
  956. HIER_PRAngles             10
  957. FLOAT yprang[3];        angles for yaw, pitch and roll
  958.  
  959. HIER_XZAngles             11
  960. FLOAT xyzang[3];        angles for X,  and Z-axis rotations
  961.                         in this order
  962.  
  963. HIER_Translate             12
  964. COORFLOAT trans[3];     translate last local origin using this vector
  965.  
  966. HIER_RelPRAngles          13
  967. FLOAT yprang[3];        relative angles for yaw, pitch and roll
  968.                         from last key-frame
  969.  
  970. HIER_RelXZAngles          14
  971. FLOAT xyzang[3];        relative angles for X,  and Z-axis rotations
  972.                         in this order from last key-frame
  973.  
  974. -----------------------------------------------------------------------------
  975.  
  976.                        OBSV_TagBase+ (0x00050000)
  977. OBSV_ObserverHierarchy      0
  978. ULONG  index;           index to observer hierarchy
  979.  
  980. OBSV_TargetHierarchy        1
  981. ULONG  index;           index to target hierarchy
  982.  
  983. OBSV_Observer               2
  984. COORFLOAT Observer[3];  location of observer/camera
  985.  
  986. OBSV_Target                 3
  987. COORFLOAT Target[3];    location of target
  988.  
  989. OBSV_Distance               4
  990. COORFLOAT Distance[3];  distance to focal plane
  991.  
  992. OBSV_Orientation            5
  993. FLOAT yprang[3];        angles for yaw, pitch and roll of camera
  994.  
  995. OBSV_Tilt                   6
  996. FLOAT tilt;             tilt angle of camera
  997.  
  998. OBSV_FieldofView            7
  999. FLOAT separation;       separation (for stereo)
  1000.  
  1001. OBSV_RecordingMedium        8
  1002. FLOAT recwidth,
  1003.       recheight;        width/height of recording medium ie.
  1004.                         35mm film, CCD, etc.
  1005.  
  1006. OBSV_FocalLength            9
  1007. FLOAT FocalLength;      focal length of lens : mm
  1008.  
  1009. OBSV_Aperture              10
  1010. FLOAT aperture;         size of aperture in mm
  1011.  
  1012. OBSV_StopNumber            11
  1013. FLOAT stopnum;          stop number
  1014.  
  1015. OBSV_ShutterSpeed          12
  1016. FLOAT shutspeed;        shutter speed
  1017.  
  1018. OBSV_Separation            13
  1019. FLOAT separation;       view separation (for stereoscopic views)
  1020.  
  1021. -----------------------------------------------------------------------------
  1022.  
  1023.                        DISP_TagBase+ (0x00060000)
  1024. DISP_WindowParms            0
  1025. WORD left, top,
  1026.       width, height;    parameters of windows in virtual screen coordinates
  1027.  
  1028. DISP_ViewStatus             1
  1029. ULONG viewstatus;       status of display
  1030.                            Label          Value
  1031.                            -----          -----
  1032.                            VOLUMERENDER   0x00000800  volume rendering
  1033.                            RADIOSIT      0x00000400  radiosity
  1034.                            RATRACE       0x00000200  raytracing
  1035.                            PHONGSHADE     0x00000100  Phong shading
  1036.                            GORAUDSHADE    0x00000080  Goraud shading
  1037.                            SOLIDMODEL     0x00000040  solid shading
  1038.                            HIDDENLINE     0x00000020  hidden line removal
  1039.                            WIREFRAME      0x00000010  wireframe
  1040.                            ZBUFFER        0x00000008  z-buffer
  1041.                            SCANLINE       0x00000004  scanline
  1042.                            XSPECS         0x00000002  stereo with XSPECS
  1043.                                                       (interlaced)
  1044.                            PERSPECT       0x00000001  perspective on
  1045.  
  1046.  
  1047. DISP_FrameRate              2
  1048. FLOAT framerate;        framerate in display
  1049.  
  1050.  
  1051. -----------------------------------------------------------------------------
  1052.  
  1053.                        BACK_TagBase+ (0x00070000)
  1054. BACK_GroundTexture          0
  1055. ULONG texindex;         index to ground texture
  1056.  
  1057. BACK_SkyTexture             1
  1058. ULONG texindex;         index to sky texture
  1059.  
  1060. BACK_EnviroTexture          2
  1061. ULONG texindex;         index to environment texture
  1062.  
  1063. -----------------------------------------------------------------------------
  1064.  
  1065. ->Light Characteristics<-
  1066.                        ATTR_LightTagBase+ (0x00080000)
  1067.  
  1068. ATTR_ColourSize             0
  1069. UWORD cols;             number of colour components for attribute
  1070.  
  1071. ATTR_Diffuse                1
  1072. ATTFLOAT
  1073. diffuse[cols];          diffuse colour components
  1074.  
  1075. ATTR_Reflect                2
  1076. ATTFLOAT
  1077. reflect[cols];          reflected colour components
  1078.  
  1079. ATTR_Transmit               3
  1080. ATTFLOAT
  1081. transmit[cols];         transmitted colour components
  1082.  
  1083. ATTR_Ambient                4
  1084. ATTFLOAT
  1085. ambient [cols];         ambient colour components
  1086.  
  1087. ATTR_Illumin                5
  1088. ATTFLOAT
  1089. illumin [cols];         illuminated colour components
  1090.  
  1091. ATTR_Opacity                6
  1092. ATTFLOAT opacity;       illuminated colour components
  1093.  
  1094. ATTR_IndexRefract           7
  1095. FLOAT indexref[cols];   indices or refraction for each colour components
  1096.  
  1097.  
  1098.  7-14    reserved for future light characteristics
  1099.  
  1100.  
  1101. ->Highlight Parameters<-
  1102.  
  1103.                        ATTR_HighlightTagBase+ (0x00081000)
  1104.  
  1105. ATTR_SpecHighLight          0
  1106. ATTFLOAT
  1107. specularpercent,
  1108. roughness;              parameters for specular highlights
  1109.  
  1110. ATTR_PhongHighLight         1
  1111. ATTFLOAT
  1112. phongpercent,
  1113. phongsize;              parameters for Phong highlights
  1114.  
  1115. ATTR_HighlightColour        2
  1116. ATTFLOAT
  1117. highlight[cols];        highlight colour components
  1118.  
  1119.  
  1120. 18-19    reserved for future highlight types
  1121.  
  1122.  
  1123. ->Lamp Attributes<-
  1124.  
  1125.                        ATTR_LampTagBase+ (0x00082000)
  1126.  
  1127. ATTR_LightIntensity         0
  1128. ATTFLOAT intensity;     intensity of light source
  1129.  
  1130. ATTR_LightDirection         1
  1131. COORFLOAT dir[3];       direction of light source
  1132.  
  1133. ATTR_ConeLight              2
  1134. FLOAT coneangle,
  1135.       conedeltaangle,
  1136.       beamdistrib;      parameters for conic light source
  1137.  
  1138. ATTR_AreaLight              3
  1139. UWORD width, height;    sample grid size for area light source
  1140.  
  1141.  
  1142. 24-30   reserved for future lamp characteristics
  1143.  
  1144.  
  1145. ->Environmental Attributes<-
  1146.  
  1147.                        ATTR_EnviroTagBase+ (0x00083000)
  1148.  
  1149. ATTR_Fog                   31
  1150. ATTFLOAT col[cols];     fog parameters
  1151. FLOAT mindist;          distance to start fog and fog colours
  1152.  
  1153. ATTR_DepthCue              32
  1154. ATTFLOAT col[cols];     depth cue parameters
  1155. FLOAT mindist;
  1156. FLOAT maxdist;          min. and max. distance over which depth cueing
  1157.                         will occur
  1158.  
  1159. ATTR_EnvironIllumin        33
  1160. ATTFLOAT illum[cols];   ambient illumination color components
  1161.  
  1162. ATTR_EnvIndexRefract       34
  1163. FLOAT index;            index of refraction of the environment
  1164.  
  1165.  
  1166. 35-50  reserved for future environment attributes
  1167.  
  1168.  
  1169. -----------------------------------------------------------------------------
  1170.  
  1171.                        TXTR_TagBase+ (0x00090000)
  1172.  
  1173.  
  1174. TXTR_Default                0
  1175. ULONG attindex;         index to default attribute serve as a base attribute
  1176.                         to provide defaults to values not modified by
  1177.                         additional texture tags
  1178.  
  1179. TXTR_RenderType             1
  1180. ULONG rendertype;       tags following this one will define textures for
  1181.                         the specified type of rendering
  1182.  
  1183.                         The following are valid rendertypes:
  1184.  
  1185.                            TXTR_SOLIDSHADING    0x00000001
  1186.                            TXTR_GORAUDSHADING   0x00000002
  1187.                            TXTR_PHONGSHADING    0x00000004
  1188.                            TXTR_ZBUFFER         0x00000008
  1189.                            TXTR_RATRACING      0x00000010
  1190.                            TXTR_RADIOSIT       0x00000020
  1191.                            TXTR_VOLUMESHADING   0x00000040
  1192.  
  1193. TXTR_Space                  2
  1194. UWORD size;            the size of texture space
  1195.  
  1196. TXTR_BoundingBox            3
  1197. COORFLOAT low[size],
  1198.          high[size];   bounding box of n-dimensional texture space
  1199.  
  1200. TXTR_Center                 4
  1201. COORFLOAT cen[size];   limits of n-dimensional texture space
  1202.  
  1203. TXTR_BitMap                 5
  1204. UWORD namelen;
  1205. UBTE name[namelen];   (not null terminated)
  1206. UWORD channel;         bitmap texture
  1207.  
  1208.  
  1209.                        TXTR_AttribTagBase+ (0x00091000)
  1210.  
  1211.  
  1212. TXTR_Checker                0
  1213. COORFLOAT scale[size];
  1214. ULONG att[2];          checker texture
  1215.  
  1216. TXTR_Gradient               1
  1217. ULONG att[size*2];     gradient texture
  1218.  
  1219. TXTR_Brick                  2
  1220. COORFLOAT mortscale;   thickness of mortar
  1221. COORFLOAT scale[size]; size of brick
  1222. ULONG attindex[2];     brick texture
  1223.  
  1224. TXTR_Wood                   3
  1225. float ringscale;
  1226. ULONG lightcolour,     indices to attributes for light-coloured wood,
  1227.       darkcolour;      dark-coloured wood and base attributes
  1228.  
  1229.                        TXTR_NormalTagBase+ (0x00092000)
  1230.  
  1231.  
  1232. TXTR_Wave                   0
  1233. BOOL displacement;
  1234. FLOAT phase,amplitude,
  1235.    wavelength,damping; wave normal mapping
  1236.  
  1237. TXTR_BumpMap                1
  1238. FLOAT minheight,
  1239.       maxheight;       bump map texture
  1240.                        (requires TXTR_BitMap tag to precede it)
  1241.  
  1242. --------------------------------------------------------------------------
  1243.  
  1244.                        SURF-X_TagBase+ (0x000A0000)
  1245. reserved for SurF-X program-specific tags
  1246.  
  1247.                        xxxxxx_TagBase+ (0x000B0000)-(0xFFFF0000)
  1248. reserved for other program-specific tags or tags for new chunks added to
  1249. this spec in the future
  1250.  
  1251. these sections can include private tags designed for internal use such
  1252. as cutting and pasting.  tags that are general enough for all programs
  1253. should go in one of the chunk sections if appropriate
  1254.  
  1255.  
  1256.  
  1257.